
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" close="true">
        <span aria-hidden="true">×</span>
    </button>
    <h4 class="modal-title">
        <span class="fa fa-legal"></span>&nbsp;修改权限
    </h4>
</div>
<div class="modal-body">
    <form class="form-horizontal layui-form">
        <input type="hidden" name="token" value="{$token}">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*上级权限:</label>
            <div class="col-sm-8">
                <select name="parent_id">
                    <option value="0">顶级权限</option>
                    <?php foreach($treeArr as $treek=>$treev):?>
                    <?php if($data["parent_id"]==$treev["id"]):?>
                    <option value="{$treev.id}" selected><?php echo str_repeat("---",$treev["level"]);?>{$treev.name}</option>
                    <?php else:?>
                    <option value="{$treev.id}"><?php echo str_repeat("---",$treev["level"]);?>{$treev.name}</option>
                    <?php endif;?>
                    <?php endforeach;?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">*权限名称:</label>
            <div class="col-sm-4">
                <input class="form-control" name="name" placeholder="账号" value="{$data.name}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">当前名称:</label>
            <div class="col-sm-4">
                <input class="form-control" name="alias" placeholder="当前名称" value="{$data.alias}">
            </div>
        </div>


        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*模块名称:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="module_name" placeholder="模块名称"
                       value="{$data.module_name}">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*控制器名称:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" placeholder="控制器名称" name="controller_name"
                       value="{$data.controller_name}">
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*方法名称:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="action_name" placeholder="方法名称"
                       value="{$data.action_name}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">*状态:</label>
            <div class="col-sm-8">
                <select name="status" lay-verify="ad_type"  lay-filter="ad_type" class="select">
                    <option value="1" {if condition="$data['status'] eq 1"} selected {/if}>启用</option>
                    <option value="2"  {if condition="$data['status'] eq 2"} selected {/if}>禁用</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label for="" class="col-sm-3 control-label">*排序:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="sort" placeholder="排序"
                       value="{$data.sort}">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">图标:</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" name="icon" placeholder="图标"  value="{$data.icon}">
            </div>
        </div>


    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default btn-sm" close="true">关闭</button>
    <button type="button" class="btn btn-primary btn-sm" _event="edit">保存</button>
</div>
<script>
    layui.use(['form'], function() {
        var form = layui.form
            , layer = layui.layer;
        var layedit = layui.layedit;
        var  tree = layui.tree;
        var util = layui.util;

        layui.form.render('select');
        form.render();
    });
</script>